﻿// Decompiled with JetBrains decompiler
// Type: Netick.MemoryAllocation
// Assembly: Netick, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 6726ECA1-C773-4CF7-8952-E81B30D93B52
// Assembly location: D:\WorkSpaceDemo\UPM\NetickForUnity\Netick\Runtime\Netick.dll
// XML documentation location: D:\WorkSpaceDemo\UPM\NetickForUnity\Netick\Runtime\Netick.xml

using System.Runtime.CompilerServices;

#nullable disable
namespace Netick;

public static class MemoryAllocation
{
  internal static IMemoryAllocator Allocator;

  [MethodImpl(MethodImplOptions.AggressiveInlining)]
  public static unsafe void* Malloc(long size, int alignment = 8)
  {
    return MemoryAllocation.Allocator.Malloc(size, alignment);
  }

  [MethodImpl(MethodImplOptions.AggressiveInlining)]
  public static unsafe void Free(void* ptr) => MemoryAllocation.Allocator.Free(ptr);

  [MethodImpl(MethodImplOptions.AggressiveInlining)]
  public static unsafe void Clear(void* ptr, long sizeBytes)
  {
    MemoryAllocation.Allocator.Clear(ptr, sizeBytes);
  }

  [MethodImpl(MethodImplOptions.AggressiveInlining)]
  public static unsafe void Copy(void* dest, void* source, long sizeBytes)
  {
    MemoryAllocation.Allocator.Copy(dest, source, sizeBytes);
  }

  [MethodImpl(MethodImplOptions.AggressiveInlining)]
  public static unsafe bool Cmp(void* ptr1, void* ptr2, long sizeBytes)
  {
    return MemoryAllocation.Allocator.Cmp(ptr1, ptr2, sizeBytes);
  }
}
